package com.ruoyi.system.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.StbHonourMapper;
import com.ruoyi.system.domain.StbHonour;
import com.ruoyi.system.service.IStbHonourService;
import com.ruoyi.common.core.text.Convert;

/**
 * 荣誉Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-02-08
 */
@Service
public class StbHonourServiceImpl implements IStbHonourService 
{
    @Autowired
    private StbHonourMapper stbHonourMapper;

    /**
     * 查询荣誉
     * 
     * @param honourId 荣誉ID
     * @return 荣誉
     */
    @Override
    public StbHonour selectStbHonourById(Long honourId)
    {
        return stbHonourMapper.selectStbHonourById(honourId);
    }

    /**
     * 查询荣誉列表
     * 
     * @param stbHonour 荣誉
     * @return 荣誉
     */
    @Override
    public List<StbHonour> selectStbHonourList(StbHonour stbHonour)
    {
        return stbHonourMapper.selectStbHonourList(stbHonour);
    }

    /**
     * 新增荣誉
     * 
     * @param stbHonour 荣誉
     * @return 结果
     */
    @Override
    public int insertStbHonour(StbHonour stbHonour)
    {
        stbHonour.setCreateTime(DateUtils.getNowDate());
        return stbHonourMapper.insertStbHonour(stbHonour);
    }

    /**
     * 修改荣誉
     * 
     * @param stbHonour 荣誉
     * @return 结果
     */
    @Override
    public int updateStbHonour(StbHonour stbHonour)
    {
        stbHonour.setUpdateTime(DateUtils.getNowDate());
        return stbHonourMapper.updateStbHonour(stbHonour);
    }

    /**
     * 删除荣誉对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteStbHonourByIds(String ids)
    {
        return stbHonourMapper.deleteStbHonourByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除荣誉信息
     * 
     * @param honourId 荣誉ID
     * @return 结果
     */
    @Override
    public int deleteStbHonourById(Long honourId)
    {
        return stbHonourMapper.deleteStbHonourById(honourId);
    }


	@Override
	public List<Map<String, Object>> selectCompHonour(StbHonour stbHonour) {
		return stbHonourMapper.selectCompHonour(stbHonour);

	}
}
